export function setLocalStorage(key, value) {
    localStorage.setItem(key, value);
}
export function getLocalStorage(key) {
    let result = localStorage.getItem(key) === null ? '' : localStorage.getItem(key);
    return result;
}
export function storageAvatar(icon, packgaeName, filename) {
    let avatarObject = getLocalStorage('icon');
    if (avatarObject === '') {
        console.log('还没东西， 你要做啥');
        avatarObject = {};
        avatarObject[`_downloads/${filename}`] = {};
        avatarObject[`_downloads/${filename}`].icon = icon;
        avatarObject[`_downloads/${filename}`].pk_n = packgaeName;
        setLocalStorage('icon', JSON.stringify(avatarObject));
    } else {
        let avatar = JSON.parse(avatarObject);
        avatar[`_downloads/${filename}`] = {};
        avatar[`_downloads/${filename}`].icon = icon;
        avatar[`_downloads/${filename}`].pk_n = packgaeName;
        setLocalStorage('icon', JSON.stringify(avatar));
    }
}
